<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script type="text/javascript" src="/admin/js-css/js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="/admin/js-css/js/jquery.ztree-2.6.min.js" ></script>
		<script type="text/javascript" src="/admin/js-css/js/tree.js" ></script>
		<script type="text/javascript" src="/admin/js-css/js/mx1.0.js"></script>
		<script type="text/javascript" src="/admin/js-css/js/mx1.0.1.js"></script>
		<link rel="stylesheet" href="/admin/plugin/zTreeStyle/zTreeStyle.css" />

	</head>
	<body>
		<div id="tree" class="tree"></div>

		<SCRIPT LANGUAGE="JavaScript">
		function zTreeOnAsyncSuccess(event, treeId, msg)
		 {
			zTree.openLevel();

		 }
		function showIconForTree(treeId, treeNode) {
   			return !treeNode.isParent;
		};
		//onload
		var	zTree;
		$(document).ready(function(){
			 // Tree
			var setting = {
				checkable : true,
				checkStyle : "radio",
				checkRadioType : "level",
				callback : {
     				// click: zTreeOnClick,
     				asyncSuccess: zTreeOnAsyncSuccess
  				 },
  			//默认打开几层节点
  			openLevel:3,
			async: true,
			asyncUrl: wwwurl+"/admin/api/DataManagementController/queryChildNodeData",  //获取节点数据的URL地址
			asyncParam: ["name", "id","type"],  //获取节点数据时，必须的数据名称，例如：id、name
			asyncParamOther: ["token",localStorage.getItem("token")] //其它参数 ( key, value 键值对格式)
			};
			var zNodes =[];
			zTree = $("#tree").zTree(setting, zNodes);
			zTree.expandAll(true);



		});



		function getData(){
			let ids = [];
			let tmp = zTree.getCheckedNodes(true);
			for(let a=0;a<tmp.length;a++){
				ids.push(tmp[a].id)
			}
			return ids;
		}



		function setData(){

		}

  </SCRIPT>


	</body>
</html>
